package com.springdemo.controller;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class DrawingController {

	public static void main(String[] args) {
		// AbstractApplicationContext can be used for closing context
		AbstractApplicationContext context = new ClassPathXmlApplicationContext(
				"spring.xml");
		context.registerShutdownHook();
		DrawingClass drawingClass = (DrawingClass) context
				.getBean("DrawingClass");
		drawingClass.drawShape();
		System.out.println(context.getMessage("greeting", null,"Default Message",null));
		context.close();
	}
}
